#include <iostream>
/**
 * 这段程序用来寻找加1能被2整除，加2能被3整除，加3能被4整除，……，加7能被8整除的数字
 * */

using namespace std;

int main (void)
{
	int x, p;
	p = 0;
	for (int i = 0; i < 1000000000; i += 40)
	{
		if (0 == (i)%8)
		{
			if (0 == (i)%7)
			{
				if (0 == (i)%5)
				{
					if (0 == (i)%3)
					{
						{
							{
								{
									x = i + 1;
									//cout << "found the num is: " << x << " " << (x-p) << endl;
									p = x;
								}
							}
						}
					}
				}
			}
		}
	}
	return 0;
}

